package branice.spring.cloud.controller;

import branice.spring.cloud.user.User;
import branice.spring.cloud.user.UserServiceImplService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {

    @Autowired
    UserServiceImplService userServiceImplService;

    @Bean
    public UserServiceImplService userServiceImplService(){
        return new UserServiceImplService();
    }

    @RequestMapping("/addUser")
    public User addUser(){
        User user = userServiceImplService.getUserServiceImplPort().addUser("aaa", "bbb");
        return user;
    }


}
